import axios from "@/util/request"

export function findAllCategory() {
    return axios({
        url: 'categorys',
        method: 'GET'
    })
}

export function saveCategory(form) {
    return axios({
        url: 'category',
        method: 'POST',
        data: {
            ...form
        }
    })
}

export function updateCategory(form) {
    return axios({
        url: 'category',
        method: 'PUT',
        data: {
            ...form
        }
    })
}

export function deleteCategoryById(id) {
    return axios({
        url: `category?id=${id}`,
        method: 'DELETE'
    })
}
